package com.marchsoft.musicalstore.controller;

import com.marchsoft.musicalstore.entity.CourseType;
import com.marchsoft.musicalstore.service.CourseTypeSer;
import com.marchsoft.musicalstore.util.RequestToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 源
 * Date: 2019-11-20
 * Time: 15:09
 */
@RestController
@RequestMapping("/courseType")
public class CourseTypeCon {
    @Autowired
    CourseTypeSer courseTypeSer;

    /**
     * 该接口用于获取课程类型，type是指0班课还是1专属课
     * @return
     */
    @RequestMapping("/getAllCourseType")
    public RequestToJson getAllCourseType(){

        List<CourseType> allCourseType = courseTypeSer.getAllCourseType();
        RequestToJson requestToJson = new RequestToJson(0,"成功",allCourseType);
//        System.out.println(123);
        return requestToJson;
    }

}
